﻿<html>

	<head>
		<title>店铺管理</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<meta HTTP-EQUIV="pragma"  CONTENT="no-cache">
			<meta HTTP-EQUIV="Cache-Control"  CONTENT="no-cache, must-revalidate">
				<meta HTTP-EQUIV="expires"  CONTENT="0">
					<link href="../../css/dialog.css" rel="stylesheet">
					<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
					<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

					<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
					<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
					<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
					<script src="../../js/lib/ligerUI/js/plugins/ligerPopupEdit.js"></script>
					<script src="../../js/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>

					<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
					<script src="../../js/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
					<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>

					<script src="../../js/lib/json2.js" type="text/javascript"></script>
					<script src="../../js/lib/jquery.form.js" type="text/javascript"></script>
					<script src="../../js/JS/Pinyin.js" type="text/javascript"></script>
					<script src="../../js/JS/layout.js" type="text/javascript"></script>
					<script src="../../js/dialog.js"></script>
					<script src="../../js/constants.js" type="text/javascript"></script>
					<script src="../../js/api.js" type="text/javascript"></script>

					<style>
						.strr {
							padding: 10px;
							width: 90%;
							font-size: 13px;
							color: #666;
							background: #FAFAFA;
							margin-top: 10px;
							padding: 10px 0;
							border: 1px solid #e1e1e1;
							background: #FAFAFA;
							-moz-border-radius: 5px;
							-webkit-border-radius: 5x;
							border-radius: 5px;
							display: none;
						}
						
						a:hover {
							cursor: pointer;
						}
					</style>
					<script type="text/javascript">
						var Fid = $api.getparastr("Fid");
						var token = $api.getStorage("token");
						$(function() {
							$("form").ligerForm();
							if(!$api.isEmpty(Fid)) {
								var url = BaseUrl + "SysStore?token=" + $api.getStorage("token") + "&Fsid=" + Fid;
								$api.ajaxget(url, {}, function(data) {
									initView(data);
								});
							}

						});

						function initView(data) {
							$api.loadJsonToForm(data.Store);
							$(".back").css("display", "block");
							$(".rule-multi-radio").ruleMultiRadio();
						}

						function doSaveInfo() {

							if(!$("#Ftitle").val()) {
								$.ligerDialog.warn('供应名不能为空');
								return;
							}
							if(!$("#Fstorecode").val()) {
								$.ligerDialog.warn('商户编号不能为空');
								return;
							} 
							var ret = $("form").serializeObject();
							ret.Fstatus = $('input[name="Fstatus"]:checked').val();
							var action = "add";
							if(!$api.isEmpty(Fid)) {
								ret.Fid = Fid;
								action = "edit";
							}
							var url = BaseUrl + "SysStore?token=" + token + "&action=" + action;
							$api.ajax2(url, ret, function(data) {
								window.location.href = "List.html";
							});
						}
					</script>
	</head>

	<body class="mainbody">
		<form>
			<!--导航栏-->
			<div class="location" width="300px">
				<table>
					<tr>
						<td>
							<span style="margin-left:10px">我的店铺</span>
						</td>
					</tr>
				</table>
			</div>
			<div class="line10"></div>

			<div class="div-content">
				<div class="divhead">基本信息</div>
				<hr class="divline" />
				<dl>
					<dt>名称</dt>
					<dd>
						<div style="float:left">
							<input type="text" id="Ftitle" name="Ftitle" placeholder='必填' ltype="text" ligerui="{width:320}" validate="{required:true,minlength:4}" />
						</div>
					</dd>
				</dl>
				<dl>
					<dt>商户号</dt>
					<dd>
						<div style="float:left">
							<input type="text" id="Fstorecode" name="Fstorecode" ltype="text" placeholder='必填' ligerui="{width:180}" validate="{required:true,length:18}" />
						</div>
						<div style="float:left">规则:区号+10000内数字 如057110001</div>
					</dd>
				</dl>
				<dl>
					<dt>联系人</dt>
					<dd>
						<input type="text" id="Fcontact" name="Fcontact" ltype="text" placeholder='选填' ligerui="{width:180}" />
					</dd>
				</dl>
				<dl>
					<dt>联系电话</dt>
					<dd>
						<input type="text" id="Fmobile" name="Fmobile" ltype="text" placeholder='选填'  />
					</dd>
				</dl>
				<dl>
					<dt>备用电话</dt>
					<dd>
						<input type="text" id="Fmobile2" name="Fmobile2" ltype="text" placeholder='选填'  />
					</dd>
				</dl>
				<dl>
					<dt>状态</dt>
					<dd>
						<div class="rule-multi-radio">
							<label><input type="radio" value="1" checked="checked"  name="Fstatus">正常</label>
							<label><input type="radio" value="2"  name="Fstatus">冻结</label>
						</div>
					</dd>
				</dl>
			</div>

			<div align="center" style="margin:20px;">
				<div style="margin-top:20px">

					<input style="margin-left:20px;width:150px;display:inline" type="button" ID="btnAduit" value="保存" class="btn yellow" onclick="doSaveInfo();" />

				</div>
			</div>

		</form>
	</body>

</html>